<script>
import {defineComponent} from 'vue'

export default defineComponent({
  name: "Counter",
  data(){
    return{

    }
  },
  emits:["update:modelValue"],
  props:{
    modelValue:{
      type:Number,
      default:0,
    }
  },
  methods:{
    changeCounter(){
      this.$emit("update:modelValue",1000)
    }
  }
})
</script>

<template>
<div class="counter">
  <h1>count的值：{{modelValue}}</h1>
  <button @click="changeCounter">changeCounter</button>
</div>
</template>

<style scoped lang="less">

</style>
